package cz.muni.fi.pa165.sme.dao.api;

import java.util.List;

import cz.muni.fi.pa165.sme.dao.entity.SportActivity;

/**
 * An interface for management of {@link SportActivity} entities in a storage.
 *
 * @author Martin Nov?k
 */
public interface SportActivityDao {
    
        /**
	 * Adds a new {@link SportActivity} to a storage, creates its ID. Object's ID must be null.
	 *
	 * @param sportActivity {@link SportActivity} to be created.
	 */
	void createSportActivity(final SportActivity sportActivity);

	/**
	 * Removes a {@link SportActivity} object from a storage. Object's ID must not be null.
	 *
	 * @param sportActivityRecord {@link SportActivity} to be removed.
	 * @throws cz.muni.fi.pa165.sme.dao.exception.ReferenceIntegrityException if the requested object is referenced in the storage.
	 */
	void deleteSportActivity(final SportActivity sportActivityRecord);

	/**
	 * Updates a {@link SportActivity} object as requested. Object's ID must not be null; parameters can be
	 * changed to null where applicable.
	 *
	 * @param sportActivityRecord {@link SportActivity} to be updated
	 */
	void updateSportActivity(final SportActivity sportActivityRecord);

	/**
	 * Finds a {@link SportActivity} object by its ID.
	 *
	 * @param id ID to be looked up in the storage
	 * @return {@link SportActivity} with the provided ID, or null if none found
	 */
	SportActivity findSportActivityById(final Long id);


	/**
	 * Finds a {@link SportActivity} object by its title.
	 *
	 * @return {@link SportActivity} with the provided title, or null if none found
	 */
	List<SportActivity> findSportActivityByTitle(final String title);

	/**
	 * Returns all {@link SportActivity}s from the storage.
	 *
	 * @return list of all {@link SportActivity}s; never null.
	 */
	List<SportActivity> findAllSportActivities();
    
}
